#ifndef _CNN_FUNCTION_H_
#define _CNN_FUNCTION_H_

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#define MAX_BBOX_NUM 5

#ifdef __cplusplus
extern "C"{
#endif
    void init_detector(const char *cfgfile, const char *weightfile);
    void run_detection(float *image_data, int width, int height, int channel, int image_original_w, int image_original_h,
                       int *detection_bbox, int max_bbox_num, int *total_bbox_num);
    void uninit_detector();

    void init_recognition(const char *cfgfile, const char *weightfile);
    void run_recognition(float *image_data, int face_num, float *feature);
    void uninit_recognition();

    void init_spoofing(const char *cfgfile, const char *weightfile);
    void run_spoofing(float *image_data, int face_num, int *is_real_face);
    void uninit_spoofing();

    void init_mtcnn(const char *cfgfile, const char *weightfile);
    void run_mtcnn(float *image_data, int face_num, float *landmark);
    void uninit_mtcnn();
#ifdef __cplusplus
}
#endif


void detection_face(cv::Mat &img, int *total_bbox_num, int *detection_bbox);
void extract_face_feature(cv::Mat &img, int face_count, float *feature, int *detection_bbox, int *code, int is_registration);
void init_network();
void uninit_network();

#endif
